//      devices.h
//      
//      Copyright 2011 DJ Shaji <djshaji@gmail.com>
//      
//      This program is free software; you can redistribute it and/or modify
//      it under the terms of the GNU General Public License as published by
//      the Free Software Foundation; either version 2 of the License, or
//      (at your option) any later version.
//      
//      This program is distributed in the hope that it will be useful,
//      but WITHOUT ANY WARRANTY; without even the implied warranty of
//      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//      GNU General Public License for more details.
//      
//      You should have received a copy of the GNU General Public License
//      along with this program; if not, write to the Free Software
//      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
//      MA 02110-1301, USA.


#ifndef DEVICE_H
#define DEVICE_H

#include <sys/stat.h>
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
#include <sys/mount.h>
#include <dirent.h>

#include "message.h"

int devices_mknod_char ( const char * pathname, int major, int minor ) ;
int devices_mknod_block ( const char * pathname, int major, int minor ) ;

void devices_mount_core ( void ) ;
void devices_mount_auto ( void ) ;

int devices_mount_device ( char * device, char * location ) ;
int devices_unmount_device ( char * device ) ;
int devices_mount_device_with_filesystem ( char * device, char * location, char * filesystem ) ;

void devices_mknod_alsa ( void ) ;

unsigned long long int
devices_makedev (unsigned int major, unsigned int minor) ;

char * core_devices [] = {
	"reserved",
	"/dev/mem",		// Physical memory access
	"/dev/kmem",	//	Kernel virtual memory access
	"/dev/null",	//	Null device
	"/dev/port",	//	I/O port access
	"/dev/zero",	//	Null byte source
	"/dev/core",	//	OBSOLETE - replaced by /proc/kcore
	"/dev/full",	//	Returns ENOSPC on write
	"/dev/random",	// Nondeterministic random number gen.
	"/dev/urandom",	// Faster, less secure random number gen.
	"/dev/aio",		// Asynchronous I/O notification interface
	"/dev/kmsg",	//	Writes to this come out as printk's
	NULL
} ;

char * oss_devices [] = {
	"/dev/mixer", 		//	Mixer control
	"/dev/sequencer",	//	Audio sequencer
	"/dev/midi00",		//	First MIDI port
	"/dev/dsp",			//	Digital audio
	"/dev/audio",		//	Sun-compatible digital audio
	"/dev/sndstat",		//	Sound card status information {2.6}
	NULL
} ;

char * filesystems [] = {
	"ext4",
	"ext3",
	"ext2",
	"vfat",
	"iso9660",
	"udf",
	NULL
} ;

#endif
